from dataaccess import ApplicationData
from common import utility

class ApplicationBiz(object):
    def __init__(self):
        pass

    def __ValidateInsert(self, application):
        valid = True
        if not valid:
            raise utility.BusinessException(message="",fieldName = "")
        
    def __ValidateUpdate(self, application):
        valid = True
        if not valid:
            raise utility.BusinessException(message="",fieldName = "")
        
    def __ValidateDelete(self, applicationID, owner):
        valid = True
        if not valid:
            raise utility.BusinessException(message="",fieldName = "")
        
    def InsertApplication(self, application):
        self.__ValidateInsert(application)
        applicationData = ApplicationData.ApplicationData()
        return applicationData.InsertApplication(application)

    def UpdateApplication(self, application):
        self.__ValidateUpdate(application)
        applicationData = ApplicationData.ApplicationData()
        applicationData.UpdateApplication(application)

    def DeleteApplication(self, applicationID, owner):
        self.__ValidateUpdate(applicationID, owner)
        applicationData = ApplicationData.ApplicationData()
        applicationData.DeleteApplication(applicationID, owner)
